<template>
	<div class="physician-skip-level">
		<div class="table-type">
			<div class="table-type-item" :class="{ 'table-type-item--active': activeTableType === 0 }"
				@click="activeTableType = 0">预警列表</div>
<!-- 			<div class="table-type-item" :class="{ 'table-type-item--active': activeTableType === 1 }"
				@click="activeTableType = 1">处置列表</div> -->
		</div>
		<div class="table">
			<el-table :data="tableData" border fit style="width: 100%" header-cell-class-name="table-header-cell"
				:class="tableData.length === 0 ? 'table-empty' : ''">
				<el-table-column v-for="item in tableConfig" :key="item.prop" :prop="item.prop" :label="item.label">
				</el-table-column>
				<template v-if="operationLabel==='查看'">
					<el-table-column :label="operationLabel" width="300">
						<template slot-scope="scope">
							<div class="operation">
								<div   @click="handleView(scope.row)">查看</div>
								<div class="handle" @click="handleState(scope.row)">去回复</div>
							</div>
						</template>
					</el-table-column>
				</template>
				<template v-else-if="operationLabel==='调查情况'">
					<el-table-column :label="operationLabel" width="300">
						<template slot-scope="scope">
							<div class="operation">
								<div  >查看</div>
							</div>
						</template>
					</el-table-column>
				</template>

			</el-table>
      <pagination class="pager" v-show="total>0" :total="total" :page.sync="queryParams.pageNum"
                  :limit.sync="queryParams.pageSize" @pagination="getList" />
		</div>


		<el-dialog title="预警列表" :visible.sync="open" width="90%" :before-close="handleClose" class="edit-dialog"
			top="40vh">
			<el-form ref="form" :rules="rules" label-width="180px">
				<div class="edit-box">
					<div class="table">
						<el-table border fit style="width: 100%" header-cell-class-name="table-header-cell"
							:class="list.length === 0 ? 'table-empty' : ''" :data="list" @selection-change="">
							<el-table-column type="selection" width="80" align="center" />
							<el-table-column label="医院名称" align="center" key="name" prop="hospitalName" />
							<el-table-column label="关键词" align="center" key="medicName" prop="keywords" />
							<el-table-column label="项目名称" align="center" key="projectName" prop="projectName" />
							<el-table-column label="预警时间" align="center" key="warnTime" prop="warnTime" />
							<template>
								<el-table-column label="操作" width="200">
									<template slot-scope="scope">
										<div class="operation">
											<div   @click="handleView2(scope.row)">查看</div>

										</div>
									</template>
								</el-table-column>
							</template>
						</el-table>
					</div>
					<pagination v-show="total>0" :total="total" background layout="prev, pager, next"
						:page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
				</div>
			</el-form>

		</el-dialog>


		<el-dialog title="预警详情" :visible.sync="open2" width="90%" :before-close="handleClose2" class="edit-dialog"
			top="40vh">
			<el-form ref="form" :rules="rules" label-width="180px">
				<div class="edit-box">
					<el-row :gutter="20">
						<el-col :span="6" :xs="24">
							<p class="ctext">处方号:{{form.clinicId }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">处方日期:{{form.clinicTime }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">就诊号:{{form.preId }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">就诊日期:{{form.preTime }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
<!--							<p class="ctext" style="color:#4373f1;" onclick="hosHandleView()">医院:{{form.registerNumber,form.signature}}</p>-->
              <p class="ctext" style="color:#4373f1;cursor: pointer;" @click="hosHandleView(form.registerNumber,form.signature)">医院:&nbsp;&nbsp;{{form.hosname }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">就诊科室:{{form.deptname }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">诊历:{{form.firstVisit }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">就诊类型:{{form.medicalType }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext" style="color:#4373f1;cursor: pointer;" @click="opendooc(form.registerNumber,form.signature)">医生姓名:{{form.doctorName }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">医生编号:{{form.doctorCode }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">医身身份证号:{{form.doctorIdCard }}</p>
						</el-col>
						<el-col :span="6" :xs="24">

						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">患者姓名:{{form.patientName }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">患者年龄:{{form.patientAge }}</p>
						</el-col>
						<el-col :span="6" :xs="24">
							<p class="ctext">患者性别:{{form.patientSex }}</p>
						</el-col>
						<el-col :span="6" :xs="24">

						</el-col>
						<el-col :span="24" :xs="24">
							<p class="ctext">主诉内容:{{form.chiefComplaint }}</p>
						</el-col>
						<el-col :span="24" :xs="24">
							<p class="ctext">疾病名称:{{form.diagnosisName }}</p>
						</el-col>

						<el-col :span="24" :xs="24">
							<div class="table">
								<el-table border fit style="width: 100%" header-cell-class-name="table-header-cell"
									:class="form.medicList.length === 0 ? 'table-empty' : ''" :data="form.medicList" @selection-change="">
									<el-table-column label="药品名称" align="center" key="projectName" prop="projectName" />
									<el-table-column label="规格" align="center" key="medicSpec" prop="medicSpec" />
									<el-table-column label="剂型" align="center" key="medicType" prop="medicType" />
									<el-table-column label="单次剂量" align="center" key="medicUsedosage" prop="medicUsedosage" />
									<el-table-column label="日数" align="center" key="medicDays" prop="medicDays" />
									<el-table-column label="数量" align="center" key="medicQuantity" prop="medicQuantity" />
									<el-table-column label="价格" align="center" key="price" prop="price" />
								</el-table>
							</div>
						</el-col>
						<el-col :span="24" :xs="24">
							<p class="ctext">药品总金额:{{form.totalPrice }}</p>
						</el-col>
						<el-col :span="24" :xs="24">
							<p class="ctext">预警项</p>
						</el-col>
						<el-col :span="24" :xs="24">
							<div class="table">
								<el-table border fit style="width: 100%" header-cell-class-name="table-header-cell"
									:class="form.warnList.length === 0 ? 'table-empty' : ''" :data="form.warnList" @selection-change="">
									<el-table-column label="序号" align="center" key="id" prop="id" />
									<el-table-column label="预警规则" align="center" key="rule" prop="rule" />
									<el-table-column label="预警内容" align="center" key="ruleContent" prop="ruleContent" />
								</el-table>
							</div>
						</el-col>
					</el-row>
				</div>
			</el-form>

		</el-dialog>

    <el-dialog title="医师信息" :visible.sync="docopen" width="50%"
               :before-close="docHandleClose" class="edit-dialog" top="40vh">
      <el-form ref="docform" :model="docform" :rules="rules" label-width="180px">
        <div class="edit-box">
          <div class="citem" >
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >医师姓名: &nbsp;{{docform.name}}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >性别: &nbsp;{{docform.sex }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >出生日期: &nbsp;{{docform.birthday }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >执业证书编码: &nbsp;{{docform.workcode }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >执业范围: &nbsp;{{docform.parcticescope }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >执业级别: &nbsp;{{docform.parcticelevel }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >多执业机构名称: &nbsp;{{docform.unitname }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >抗菌药物处方权: &nbsp;:{{getantibiosisAuthority(docform.antibiosis_authority) }}</p>
          </div>
        </div>
      </el-form>
    </el-dialog>

    <el-dialog title="医院信息" :visible.sync="hosopen" width="100%"
               :before-close="hosHandleClose" class="edit-dialog" top="40vh">
      <el-form label-width="180px" style="background-color: #eef1fa;">
        <div class="edit-box">
          <div class="organization-detail">
            <div class="title">医疗机构详情</div>
            <div class="card">
              <div class="org-name">{{ dataInfo.orgName }}</div>
              <div class="org-address">地址：{{ dataInfo.orgAddress }}</div>
              <div class="legal-person">法人：{{ dataInfo.legalPerson }}</div>
            </div>
            <div class="card">
              <SubTitle title="基本信息"></SubTitle>
              <div class="row">医院名称：{{ dataInfo.orgName }}</div>
              <div class="row">医院简介：</div>
              <div class="row">{{ dataInfo.description }}</div>
              <div class="org-detail-info">
                <div class="info-item" v-for="item in dataInfo.detailInfo">
                  <div class="label">{{ item.label }}：</div>
                  <div class="value">{{ item.value }}</div>
                </div>
              </div>
            </div>
            <div class="card">
              <SubTitle title="诊疗科目"></SubTitle>
              <div class="medical-subject" v-for="item in dataInfo.medicalSubject" :key="item">{{ item }}</div>
            </div>
            <div class="card">
              <SubTitle title="技术资质"></SubTitle>
              <div class="tech-qualification-container">
                <div class="item" v-for="item in dataInfo.qualification" :key="item.label">
                  {{ item.label }}：{{ item.value }}
                </div>
              </div>
            </div>
            <div class="card">
              <SubTitle title="医师列表"></SubTitle>
              <div class="table">
                <el-table
                  :data="hosDoctableData"
                  border
                  fit
                  style="width: 100%"
                  header-cell-class-name="table-header-cell"
                >
                  <el-table-column
                    label="序号"
                    type="index"
                    width="50">
                  </el-table-column>
                  <el-table-column label="医生姓名" align="center" prop="name" />
                  <el-table-column label="医师类别" align="center" prop="parcticeclass" />
                  <el-table-column label="任职资格" align="center" prop="workcpet" />
                  <el-table-column label="执业范围" align="center" prop="parcticescope" />
                  <el-table-column label="主要执业机构" align="center" prop="unit" />
                  <el-table-column label="美容专业" align="center" prop="beautyMajor" />
                  <el-table-column label="技术资质" align="center" prop="technicalTitle" />
                  <!--			                <el-table-column label="精麻处方权" align="center" prop="anestheticAuthority" />-->
                  <el-table-column label="精麻处方权" align="center" prop="anestheticAuthority" >
                    <template slot-scope="scope">
                      <span v-if="scope.row.anestheticAuthority === 0">无</span>
                      <span v-if="scope.row.anestheticAuthority === 1">有</span>
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" >
                    <template slot-scope="scope">
                      <div class="operation">
                        <div   @click="hosDocHandleView(scope.row)">查看</div>
                      </div>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
        </div>
      </el-form>
    </el-dialog>

    <el-dialog title="查看信息" :visible.sync="hosDocHandleViewOpen" width="50%"
               :before-close="hosDochandleClose" class="edit-dialog" top="40vh">
      <el-form ref="hosDocform" :model="hosDocform" label-width="180px">
        <div class="edit-box">
          <div class="citem" >
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >医生名称: &nbsp;{{hosDocform.name }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >医师类别: &nbsp;{{hosDocform.parcticeclass }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >任职资格: &nbsp;{{hosDocform.workcpet }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext"  >执业范围: &nbsp;{{hosDocform.parcticescope }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >主要执业机构: &nbsp;{{hosDocform.unit }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >美容专业: &nbsp;{{hosDocform.beautyMajor }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <p class="ctext" >技术资质: &nbsp;{{hosDocform.technicalTitle }}</p>
          </div>
          <div class="citem">
            <img src="@/assets/fronts/round.png" class="cimage">
            <!--            <p class="ctext" >精麻处方权: &nbsp;{{hosDocform.anestheticAuthority ===1 }}</p>-->
            <p class="ctext" >精麻处方权: &nbsp;
              <span v-if="hosDocform.anestheticAuthority === 0">无</span>
              <span v-if="hosDocform.anestheticAuthority === 1">有</span>
            </p>
          </div>
        </div>
      </el-form>

    </el-dialog>

    <!-- 新增 处置状态列表-->
    <el-dialog title="处置状态列表" :visible.sync="doState" width="100%" :before-close="doStateClose" class="edit-dialog"
               top="40vh">
      <el-form ref="slist" :rules="rules" label-width="100px">
        <el-row>
          <el-col :span="24" :xs="24">
            <div class="table">
              <el-table border fit style="width: 100%" header-cell-class-name="table-header-cell"
                        :data="slist" >
                <el-table-column label="id" align="center" key="id" prop="id" />
                <el-table-column label="处置状态" align="center" key="punishState" prop="punishState">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.punishState == '0'">未处置</el-tag>
                    <el-tag v-if="scope.row.punishState == '1'">处置中</el-tag>
                    <el-tag v-if="scope.row.punishState == '3'">处置完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column label="监督单位" align="center" key="deptName" prop="deptName" />
                <el-table-column label="监督部门" align="center" key="postName" prop="postName" />
                <el-table-column label="处置人" align="center" key="realName" prop="realName" />
                <el-table-column label="处置时间" align="center" key="punishTime" prop="punishTime"/>
                <el-table-column label="建议内容" width="130">
                  <template slot-scope="scope">
                    <div class="operation">
                      <div   @click="contentFo(scope.row)">查看</div>
                    </div>
                  </template>
                </el-table-column>

                <el-table-column label="建议文书" width="130">
                  <template slot-scope="scope">
                    <div class="operation">
                      <div   @click="down(scope.row)">下载</div>
                    </div>
                  </template>
                </el-table-column>

                <el-table-column label="被处置机构" align="center" key="institutionName" prop="institutionName"
                />
                <el-table-column label="回复内容" width="130">
                  <template slot-scope="scope">
                    <div class="operation">
                      <div   @click="replyFo(scope.row)">查看</div>
                    </div>
                  </template>
                </el-table-column>

                <el-table-column label="回复文件" width="130">
                  <template slot-scope="scope">
                    <div class="operation">
                      <div   @click="downHf(scope.row)">下载</div>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column label="回复时间" align="center" key="reTime" prop="reTime"  />
                <el-table-column label="操作" >
                  <template slot-scope="scope">
                    <div class="operation">
                      <div   @click="reply(scope.row)">回复</div>
                    </div>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <pagination
        v-show="totalWarn>0"
        :total="totalWarn"
        :page.sync="queryParamsWarn.pageNum"
        :limit.sync="queryParamsWarn.pageSize"
        @pagination="getListWarn"
      />
    </el-dialog>


    <el-dialog title="处置内容" :visible.sync="contentOpen" width="90%" :before-close="handleCloseContent" class="edit-dialog"
               top="40vh">
      <el-form ref="form" label-width="180px">
        <div class="edit-box">
          <el-row :gutter="20">
            <el-col :span="6" :xs="24">
              <p class="ctext">处置内容:&nbsp;&nbsp;{{contentForm.punishContent }}</p>
            </el-col>
          </el-row>
        </div>
      </el-form>

    </el-dialog>

    <el-dialog title="处置信息" :visible.sync="doOpen1" width="80%" :before-close="doHandleClose" class="edit-dialog"
               top="40vh">
      <el-form ref="doform" :model="doform" label-width="100px">
        <el-row>
          <el-col :span="24" :xs="24">
            <el-form-item label="处置标题" prop="punishTitle">
              <el-input v-model="doform.punishTitle" placeholder="请输入处置标题"  />
            </el-form-item>
          </el-col>
          <el-col :span="24" :xs="24">
            <el-form-item label="处置内容" prop="punishContent">
              <el-input type="textarea" v-model="doform.punishContent" placeholder="请输入处置内容" />
            </el-form-item>
          </el-col>
          <el-col :span="24" :xs="24">
            <el-form-item label="处置状态" prop="punishState">
              <el-select v-model="doform.punishState"  placeholder="请选择">
                <el-option
                  v-for="item in states"
                  :key="item.tag"
                  :label="item.label"
                  :value="item.tag"
                  :disabled="item.tag == 0"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>


          <el-col :span="12" :xs="24">
            <div class="physician-info">
              <input type="file" id="physician-info" >
              <div class="upload-content" v-for="item in fileLists" :key="item" >
                <div class="name" :title="item">&nbsp;&nbsp;&nbsp;{{ item }}</div>
                <label class="btn" @click="deleteFile(item)">删除文件</label>
              </div>
              <div class="upload-content" >
                <div class="name"></div>

                <label class="btn" for="physician-info"> <file-upload ref="modalForm" @input="files" ></file-upload></label>
              </div>

            </div>
          </el-col>
          <el-col :span="12" :xs="24">

          </el-col>
          <el-col :span="24" :xs="24">
            <p class="ctext" style="font-size: 14px;color: #666;font-weight: bold;">处置项列表</p>
          </el-col>
          <el-col :span="24" :xs="24">
            <div class="table">
              <el-table border fit style="width: 100%" header-cell-class-name="table-header-cell"
                        :class="list.length === 0 ? 'table-empty' : ''" :data="list" @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="80" align="center" />
                <el-table-column label="医院名称" align="center" key="name" prop="hospitalName" />
                <!--						  	<el-table-column label="总数" align="center" key="medicName" prop="total" />-->
                <el-table-column label="项目名称" align="center" key="projectName" prop="projectName" />
                <el-table-column label="预警时间" align="center" key="warnTime" prop="warnTime" />
                <template>
                  <el-table-column label="详情" width="250">
                    <template slot-scope="scope">
                      <div class="operation">
                        <div   @click="handleView2(scope.row)">查看</div>
                        <div   @click="handleState(scope.row)">处执中</div>
                      </div>
                    </template>
                  </el-table-column>
                </template>
              </el-table>
            </div>
            <pagination
              class="pager"
              v-show="listTotal>0"
              :total="listTotal"
              :page.sync="queryList.pageNum"
              :limit.sync="queryList.pageSize"
              @pagination="handleView"
            />
          </el-col>
        </el-row>
      </el-form>
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
      <div slot="footer" class="dialog-footer">
        <el-button @click="submitForm">处置</el-button>
        <el-button @click="doHandleClose">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="回复信息" :visible.sync="doOpenHf" width="80%" :before-close="doHandleCloseHf" class="edit-dialog"
               top="40vh">
      <el-form ref="doformHf" :model="doformHf" label-width="100px">
        <el-row>
          <el-col :span="24" :xs="24">
            <el-form-item label="回复内容" prop="punishContent">
              <el-input type="textarea" v-model="doformHf.reContent" placeholder="请输入回复内容" />
            </el-form-item>
          </el-col>
          <el-col :span="12" :xs="24">
            <div class="physician-info">
              <div class="upload-content" v-for="item in fileLists" :key="item" >
                <div class="name" :title="item">&nbsp;&nbsp;&nbsp;{{ item }}</div>
                <label class="btn" @click="deleteFile(item)">删除文件</label>
              </div>
              <div class="upload-content" >
                <div class="name"></div>
                <label class="btn" for="physician-info"> <file-upload ref="modalForm" @input="files" ></file-upload></label>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="submitFormHf">回复</el-button>
        <el-button @click="doHandleCloseHf">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="回复内容" :visible.sync="contentOpenHf" width="90%" :before-close="handleCloseContentHf" class="edit-dialog"
               top="40vh">
      <el-form ref="form" label-width="180px">
        <div class="edit-box">
          <el-row :gutter="20">
            <el-col :span="6" :xs="24">
              <p class="ctext">回复内容:&nbsp;&nbsp;{{contentFormHf.reContent}}</p>
            </el-col>
          </el-row>
        </div>
      </el-form>

    </el-dialog>



	</div>
</template>
<script>

import SubTitle from '@/components/sub-title/index.vue'
import {getHospitalData} from "../../../../api/his/all";

import {
  listNoRightsKjWarn,mylistNoRightsKjWarn,
  listHsNoKjRightsWarnDetails,
  listchildBeyondWarn,
  listchildBeyondWarnDetails,
  listchildBeyondWarnList,
  listlicensedWarn
} from "../../../../api/his/warn";
import { listNation, getNation, delNation, addNation, updateNation, exportNation } from "@/api/system/nation";
import { addPunish, listPunish, updatePunish} from "@/api/his/punish";
import { listDockor, getDockor, delDockor, addDockor, updateDockor, exportDockor} from "@/api/his/dockor";
import fileUpload from "@/components/FileUpload"
import {getDockorInfo} from "../../../../api/his/dockor";
import { listAll  } from "@/api/his/doctorAll";



	export default {
		name: 'PhysicianSkipLevel',
    components: {SubTitle,fileUpload,listDockor, getDockor, delDockor, addDockor, updateDockor, exportDockor
    },
		data() {
			return {
        fileListsHf:[],
        fileListHf:[],
        doOpenHf:false,
        doformHf:{},
        contentOpenHf:false,
        contentFormHf: {},
        queryList:{
          registerNumber:'',
          pageNum: 1,
          pageSize: 10
        },
        contentForm: {},
        queryParamsWarn: {
          id: null,
          pageNum: 1,
          pageSize: 10
        },
        totalWarn: 0,
        slist:[

        ],
        listTotal: 0,
        queryParams: {
          id: null,
          pageNum: 1,
          pageSize: 10
        },
        list: [],
        fileList: [],
        fileLists: [],
        states:[
          {
            label:'未处置',
            tag: 0
          },
          {
            label:'处置中',
            tag: 1
          },
          {
            label:'处置完成',
            tag: 2
          }
        ],
        doform: {

        },
        contentOpen:false,
        doOpen1: false,  //处置
        doState: false,  //处置状态
				activeTableType: 0,
				tableConfig: [],
				tableData: [],
				// 遮罩层
				loading: true,
				// 弹出层标题
				title: "",
				// 是否显示弹出层
				open: false,
				open2: false,
        docopen:false, //医生
        hosopen:false,
        hosDocHandleViewOpen:false,
        hosDocform:{},
				total: 1,
				// 预警详情表单参数
        form: {
          clinicId: '',
          clinicTime: '',
          preId: '',
          preTime: '',
          hosname: '',
          deptname: '',
          firstVisit:'',
          medicalType:'',
          doctorName:'',
          doctorCode:'',
          doctorIdCard:'',
          patientName:'',
          patientAge:'',
          patientSex:'',
          chiefComplaint:'',
          diagnosisName:'',
          medicList:[],
          totalPrice:'',
          warnList:[]
        },
        //医院的
        dataInfo: {
          orgName: '',
          orgAddress: '',
          legalPerson: '',
          description: '',
          medicalSubject: [],
          qualification: [

          ],
          detailInfo: [

          ],
        },
        docform:{},
        ids:[],
				rules: {}
			}
		},
		computed: {
			pageType() {
				if (this.$route.query.activeTab === '0') {
					if (this.activeTableType === 0) {
						return '00'
					}
					if (this.activeTableType === 1) {
						return '01'
					}
				}
				if (this.$route.query.activeTab === '1') {
					if (this.activeTableType === 0) {
						return '10'
					}
					if (this.activeTableType === 1) {
						return '11'
					}
				}
				return '00'
			},
			operationLabel() {
				if (this.activeTableType === 0) {
					return '查看'
				} else {
					return '调查情况'
				}
			}
		},
    created() {
      this.getList()
      // this.startTime();
    },
		methods: {
      startTime(){
        this.timer = setInterval(this.timeRun, 500);
      },
      timeRun(){
        if(window.location.href!=this.lastpath&&window.location.href.includes('child-warn')){
          // alert(111)
          this.getList()
        }
      },
      lastSegment() {
        if(window.location.href){
          this.lastpath = window.location.href
          const lastSlashIndex = this.lastpath.lastIndexOf('/');
          return lastSlashIndex !== -1 ? this.lastpath.substring(lastSlashIndex + 1) : this.lastpath;
        }
        return null
      },
      downHf(data) {
        if (data.reFile.includes(",")){
          for (let i = 0; i < data.reFile.split(",").length; i++) {
            this.$download.resource(data.reFile.split(",")[i])
          }
        } else {
          this.$download.resource(data.reFile)
        }
      },
      handleCloseContentHf() {
        this.contentOpenHf = false
      },
      replyFo(data) {
        this.contentOpenHf = true
        this.contentFormHf.reContent = data.reContent
      },
      reply(data) {
        this.doformHf.id = data.id
        this.doOpenHf = true
        this.fileLists = []
        this.doformHf.reContent = ''
        this.fileList = []
      },
      /** 提交按钮 */
      submitFormHf() {
        if(this.doformHf.reContent == null || this.doformHf.reContent == undefined){
          return this.$modal.msgError("回复内容必填");
        }
        if(this.fileLists.length == 0){
          return this.$modal.msgError("请上传文件");
        }
        this.doformHf.reFile = this.fileLists.join(', ')
        updatePunish(this.doformHf).then(response => {
          this.$modal.msgSuccess("处置成功");
          this.doOpenHf = false
          this.doOpen1 = false
          this.fileLists = []
          this.fileList = []
          this.getList();
        });
      },
      deleteFileHf (data) {
        this.fileLists.splice(data, 1);
        console.log("11111111",this.fileLists)
      },
      doHandleCloseHf() {
        this.doOpenHf = false
      },
      filesHf(data) {
        this.fileList.push(data);
        console.log("222222222",this.fileList)
        let listElement = this.fileList[this.fileList.length - 1];
        for (let i = 0; i < listElement.split(",").length; i++) {
          this.fileLists.push(listElement.split(",")[i])
        }
        this.fileLists = Array.from(new Set(this.fileLists))
        console.log("33333333333",this.fileLists)
      },
      files(data) {
        this.fileList.push(data);

        let listElement = this.fileList[this.fileList.length - 1];
        for (let i = 0; i < listElement.split(",").length; i++) {
          this.fileLists.push(listElement.split(",")[i])
        }
        this.fileLists = Array.from(new Set(this.fileLists))
      },
      deleteFile (data) {
        this.fileLists.splice(data, 1);
      },
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        console.log("ids" , this.ids)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      doHandleClose() {
        this.doOpen1 = false
      },
      contentFo(data) {
        this.contentOpen = true
        this.contentForm.punishContent = data.punishContent
      },
      down(data) {
        if (data.punishFile.includes(",")){
          for (let i = 0; i < data.punishFile.split(",").length; i++) {
            this.$download.resource(data.punishFile.split(",")[i])
          }
        } else {
          this.$download.resource(data.punishFile)
        }
      },
      docHandleView(res,res1) {
        this.docopen = true;
        const queryParamDoc = {
          "registerNumber":res,
          "signature":res1,
          "pageNum":1,
          "pageSize":1}
        listAll(queryParamDoc).then(response=>{
          const rows = response.rows;
          if(rows.length){
            this.docform = rows[0];
          }
        })
      },
      //处置状态弹窗
      handleState(row){
        this.getListWarn(row.warnId)
        this.warnId = row.warnId
        this.doState = true
      },
      getListWarn(id) {
        if(id==null || id==undefined){
          id=this.warnId
        }
        this.queryParamsWarn.warnId = id
        listPunish(this.queryParamsWarn).then(response => {
          this.slist = response.rows;
          this.totalWarn = response.total;
        });
      },
      doView(row){
        this.doform = {
          punishTitle: '',
          punishContent: '',
          punishState: ''
        };
        this.fileLists = []
        this.fileList = []
        this.ids = []
        this.doform.registerNumber = row.registerNumber
        console.log("111", this.doform)
        this.doOpen1 = true
      },
			// 表单重置
			reset() {
				this.list = {

				};
				this.resetForm("form");
			},
			/** 查看按钮操作 */
			handleView(row) {

				this.open2 = true;
        this.queryParams.id = row.id;
        listchildBeyondWarnDetails(this.queryParams).then(response => {
          this.form = response.data;
          var a = response.data;
          });
			},
			handleClose() {
				this.open2 = false
			},

      /** 查看按钮操作 */
      //医院
      hosHandleView(res1,res2) {
        this.hosopen = true;
        getHospitalData({"registerNumber":res1,"signature":res2}).then(response=>{
          const data = response.data
          this.dataInfo.orgName = data.institutionName;
          this.dataInfo.orgAddress = data.medicalAddress;
          this.dataInfo.legalPerson = data.medicalLegalrepresentative;
          this.dataInfo.description = '';

          for (let i = 0; i < data.medicalSpecialtiesName.split("/").length; i++) {
            this.dataInfo.medicalSubject.push(data.medicalSpecialtiesName.split("/")[i])
          }
          this.dataInfo.detailInfo = [
            {
              label: '统一社会信用代码',
              value: data.medicalUscc
            },
            {
              label: '所有制形式',
              value: data.medicalOwnership
            },
            {
              label: '是否有放射所有权',
              value: ''
            },
            {
              label: '登记号',
              value: data.registerNumber
            },
            {
              label: '机构属性',
              value: data.medicalCategory
            },
            {
              label: '放射诊疗许可证',
              value: ''
            },
            {
              label: '全国唯一识别码',
              value:data.uniqueCode
            }
          ]
        })

        const queryParamDoc = {
          "registerNumber":res1,
          "signature":res2,
          "pageNum":1,
          "pageSize":100}
        listAll(queryParamDoc).then(response=>{
          const rows = response.rows;
          this.hosDoctableData = rows
        })
      },

      hosHandleClose() {
        this.hosopen = false
      },

			/** 查看具体操作 */
			handleView2(row) {
				this.open2 = true;
        this.queryParams.id = row.id;
        listHsNoKjRightsWarnDetails(this.queryParams).then(response => {
          this.form = response.data;
        });
			},

      hosDocHandleView(row){
        this.hosDocHandleViewOpen = true;
        this.hosDocform = row;
      },
      hosDochandleClose(){
        this.hosDocHandleViewOpen = false;
      },

      opendooc(res,res1){
        this.docopen = true;
        // const queryParamDoc = {"registerNumber":res}
        // listDockor(queryParamDoc).then(response => {
        //   const rows = response.rows;
        //   if (rows.length > 0){
        //     this.docform = rows[0];
        //   }
        // });
        const queryParamDoc = {
          "registerNumber":res,
          "signature":res1,
          "pageNum":1,
          "pageSize":1}
        listAll(queryParamDoc).then(response=>{
          console.log(response)
          const rows = response.rows;
          if(rows.length){
            this.docform = rows[0];
          }
        })
      },
			handleClose2() {
				this.open2 = false
			},
      docHandleClose() {
        this.docopen = false
      },
      getantibiosisAuthority(au){
        if (au === 0){
          return '无抗菌药物处方权'
        }else if (au === 1){
          return '非限制级'
        }else if (au === 2){
          return '限制级'
        }else if (au === 3){
          return '特殊级'
        }else{
          return '未知'
        }
      },
			/** 提交按钮 */
			submitForm() {
        this.doform.ids = this.ids
        if(this.ids.length == 0){
          return this.$modal.msgError("请勾选处置项列表");
        }

        if(this.doform.punishTitle == null || this.doform.punishTitle == undefined){
          return this.$modal.msgError("处置标题必填");
        }
        if(this.doform.punishContent == null || this.doform.punishContent == undefined){
          return this.$modal.msgError("处置内容必填");
        }
        if(this.doform.punishState == null || this.doform.punishState == undefined){
          return this.$modal.msgError("处置状态必填");
        }
        if(this.fileLists.length == 0){
          return this.$modal.msgError("请上传文件");
        }
        this.doform.punishFile = this.fileLists.join(', ')
        addPunish(this.doform).then(response => {
          this.$modal.msgSuccess("处置成功");
          this.doOpen1 = false
          this.getList();
        });
			},
			// 查询
			getList() {
				this.loading = true;
        mylistNoRightsKjWarn(this.queryParams).then(response => {
          this.tableData = response.rows;
          this.list = response.rows;
          this.total = response.total;
        });
			},
		},
		watch: {
			'$route.query': {
				immediate: true,
				deep: true,
				handler() {
					if (this.pageType === '00') {
						this.tableConfig = [{
								prop: 'clinicId',
								label: '就诊流水号',
							},
							{
								prop: 'preId',
								label: '处方流水号',
							},
              {
								prop: 'projectName',
								label: '项目名称',
							},
							{
								prop: 'punishTitle',
								label: '处置标题',
							},
              {
								prop: 'punishContent',
								label: '处置内容',
							},
							{
								prop: 'punishTime',
								label: '处置时间',
							},
						]
					} else if (this.pageType === '01') {
						this.tableConfig = [{
								prop: 'id',
								label: '处置编号',
							},
							{
								prop: 'hospital',
								label: '医疗机构',
							},
							{
								prop: 'region',
								label: '辖区',
							},
							{
								prop: 'person',
								label: '处置人',
							},
							{
								prop: 'count',
								label: '处置条数',
							},
							{
								prop: 'date',
								label: '处置时间',
							},
						]
					} else if (this.pageType === '10') {
						this.tableConfig = [{
								prop: 'hospital',
								label: '医院名称',
							},
							{
								prop: 'code',
								label: '登记号',
							},
							{
								prop: 'nextCheckDate',
								label: '下一校验日期',
							},
							{
								prop: 'region',
								label: '辖区',
							},
							{
								prop: 'orgCode',
								label: '机构识别代码',
							},
							{
								prop: 'preWarningDate',
								label: '预警日期',
							},
						]
					} else if (this.pageType === '11') {
						this.tableConfig = [{
								prop: 'hospital',
								label: '医院名称',
							},
							{
								prop: 'code',
								label: '登记号',
							},
							{
								prop: 'nextCheckDate',
								label: '下一校验日期',
							},
							{
								prop: 'region',
								label: '辖区',
							},
							{
								prop: 'orgCode',
								label: '机构识别代码',
							},
							{
								prop: 'preWarningDate',
								label: '预警日期',
							},
						]
					} else {
						return []
					}
				}
			}
		}
	}
</script>
<style scoped lang="scss">
  .physician-info {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  #physician-info {
    display: none;
  }

  .upload-content {
    display: flex;
    height: 58px;
    margin-top: 20px;

    .name {
      width: 300px;
      height: 100%;
      background: #FFFFFF;
      border-radius: 5px;
      line-height: 35px;
      padding: 0 20px;
      margin-right: 19px;
      font-weight: 500;
      font-size: 14px;
      color: #9a9a9a;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .btn {
      text-align: center;
      line-height: 35px;
      width: 90px;
      height: 35px;
      background: #4373F1;
      border-radius: 5px;
      cursor: pointer;
      font-weight: 500;
      font-size: 14px;
      color: #FFFFFF;
    }
  }
  .physician-skip-level {
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	.table-type {
		display: flex;
		align-items: center;
		margin-top: 18px;
		padding-bottom: 13px;

		&-item {
			font-weight: 500;
			font-size: 26px;
			color: #4B4B4B;
			height: 25px;
			line-height: 25px;
			margin-right: 26px;
			cursor: pointer;

			&--active {
				font-weight: bold;
				position: relative;

				&::after {
					position: absolute;
					content: "";
					width: 47px;
					height: 5px;
					bottom: -13px;
					left: 50%;
					transform: translateX(-50%);
					background: #4373F1;
					border-radius: 3px;
				}
			}
		}
	}

	.table {
		flex: 1;
		background-color: #fff;
		margin: 13px 0 16px;

		::v-deep .table-header-cell {
			background-color: #EBEFF8;
			padding-left: 21px;
			font-weight: 500;
			font-size: 16px;
			color: #414141;
		}

		.el-table {
			height: 100%;
		}

		::v-deep .el-table__cell {
			padding-left: 21px;
			font-weight: 500;
			font-size: 16px;
			color: #414141;
		}

		:v-deep .el-table__body-wrapper {
			height: 100%;
		}

		:v-deep .el-table__empty-block {
			height: 100%;
		}

		.operation {
			display: flex;
			align-items: center;
			height: 100%;

			.view {
				cursor: pointer;
				font-weight: 500;
				font-size: 16px;
				color: #414141;
				height: 16px;
				line-height: 16px;
				background-repeat: no-repeat;
				background-position: 0 center;
				margin-right: 20px;
				user-select: none;
				display: inline-block;
			}

			.handle {
				margin-left: 77px;
				user-select: none;
				cursor: pointer;
				text-align: center;
				line-height: 32px;
				width: 78px;
				height: 32px;
				background: #4373F1;
				border-radius: 5px;
				font-weight: 500;
				font-size: 16px;
				color: #FFFFFF;
				display: inline-block;
			}
		}
	}

	.handle1 {
		margin-left: 77px;
		user-select: none;
		cursor: pointer;
		text-align: center;
		line-height: 32px;
		width: 78px;
		height: 32px;
		background: #4373F1;
		border-radius: 5px;
		font-weight: 500;
		font-size: 16px;
		color: #FFFFFF;
		display: inline-block;
		float: right;
		margin-right: 60px;
	}
	.ctext{
		display: inline-block;
		text-align: center;
		font-size: 14px;
		color:#888;
	}
  .edit-box {
    padding: 0px;
    display: flex;
    flex-direction: column;
    align-items: left;

    ::v-deep .el-dialog__footer {
      display: none;
    }

    .citem{
      display: flex;
      align-items: center;
      height: 40px;
      .cimage{
        margin-right: 0px;
        width:30px;
        height: 30px;
        display:inline-block;
      }
      .ctext{
        display: inline-block;
        text-align: left;
      }
    }

  }
  .card {
    background-color: #fff;
    padding: 19px 13px 19px;
    margin-top: 14px;
  }
  .organization-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: default;

    .title {
      margin-top: 10px;
      font-weight: bold;
      font-size: 26px;
      line-height: 26px;
      color: #4B4B4B;
    }

    .org-name {
      font-weight: bold;
      font-size: 20px;
      color: #4B4B4B;
      line-height: 39px;
    }

    .org-address, .legal-person {
      font-weight: 500;
      font-size: 16px;
      color: #4B4B4B;
      line-height: 30px;
    }

    .row {
      font-weight: 500;
      font-size: 16px;
      color: #4B4B4B;
      line-height: 25px;
      margin-top: 6px;
    }

    .org-detail-info {
      display: flex;
      flex-wrap: wrap;

      .info-item {
        width: 530px;
        display: flex;
        align-items: center;
        margin-top: 8px;
        font-weight: 500;
        font-size: 16px;
        color: #8B8B8B;

        .label{
          white-space: nowrap;
          width: 133px;
        }
      }
    }

    .medical-subject {
      margin-top: 24px;
      border-radius: 5px;
      border: 1px solid #DCDCDC;
      text-align: center;
      height: 39px;
      line-height: 39px;
      font-weight: 500;
      font-size: 16px;
      color: #505050;
      padding: 0 30px;
      display: inline-block;
      margin-right: 13px;
    }

    .tech-qualification-container {
      display: flex;
      flex-wrap: wrap;
      margin-top: 20px;

      .item {
        font-weight: 500;
        font-size: 16px;
        color: #8B8B8B;
        margin-right: 120px;
      }

    }
  }
  .citem{
    display: flex;
    align-items: center;
    height: 40px;
    .cimage{
      margin-right: 0px;
      width:30px;
      height: 30px;
      display:inline-block;
    }
    .ctext{
      display: inline-block;
      text-align: left;
    }
  }

</style>
